﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="menu.aspx.cs" Inherits="AnyOffice.general.system.address.menu" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
	<HEAD>
		<title></title>
		<meta content="C#" name="CODE_LANGUAGE">
		<meta content="JavaScript" name="vs_defaultClientScript">
		<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
		
	</HEAD>
	<body class="panel" leftMargin="0" topMargin="0">
		<form id="Form1" method="post" runat="server">
			<!---------------------- 分组 -------------------------------->
			<table class="small" cellSpacing="1" cellPadding="3" width="100%" align="center" bgColor="#000000"
				border="0">
				<tr class="TableHeader" style="CURSOR: hand" onclick="clickMenu('menu_1')">
					<td title="" noWrap align="center" colSpan="5"><b>联系人分组</b></td>
				</tr>
			</table>
			<table class="small" id="menu_1" cellSpacing="1" cellPadding="3" width="100%" bgColor="#000000"
				border="0">
				<tr class="TableData" align="center">
					<td class="menu_comon" id="group_1" onmouseover="setGroupPointer(this, '#B3D1FF',1)" style="CURSOR: hand"
						onclick="view_group(this,0,1)" onmouseout="setGroupPointer(this, '#FFFFFF',1)" noWrap
						width="100%" bgColor="#d9e8ff">默认</td>
				</tr>
				<asp:repeater id="rptGroup" runat="server"  EnableViewState="False">
				<ItemTemplate>
					<tr class="TableData" align="center">
					<td class="menu_comon" id="group_<%#Eval("ID")%>" onmouseover="setGroupPointer(this, '#B3D1FF',<%#Eval("ID")%>)" style="CURSOR: hand"
						onclick="view_group(this,<%#Eval("GroupId")%>,<%#Eval("ID")%>)" onmouseout="setGroupPointer(this, '#FFFFFF',<%#Eval("ID")%>)" noWrap
						width="100%"><%#Eval("GroupName")%></td>
				</tr>
				</ItemTemplate>
				</asp:repeater>
				</table>
			<script language="JavaScript">
var td_id=1;
var group_nums = <% = ViewState["GroupNums"] %> + 1;

function setGroupPointer(theRow, thePointerColor,td_id_over)
{
   if(td_id!=td_id_over)
  {
	if(thePointerColor == "#B3D1FF")
		theRow.className="menu_active";
	else
		theRow.className="menu_comon";
  }
}
function clickMenu(ID)
{
    targetelement=document.all(ID);
    if (targetelement.style.display=="none")
        targetelement.style.display='';
    else
        targetelement.style.display="none";
}

function view_group(theRow,group_id,group_count)
{
	 parent.main.location="address.aspx?group_id="+group_id;
     td_id=group_count;
    
      for(i=1;i<=index_nums;i++)
     {
		targetelement=document.all('index_' + i);
		targetelement.className="menu_comon";
     }
     
     for(i=1;i<=group_nums;i++)
     {
		targetelement=document.all('group_' + i);
		targetelement.className="menu_comon";		
     }
     theRow.className="menu_active";
}
			</script>
			<!---------------------- 索引 -------------------------------->
			<table class="small" cellSpacing="1" cellPadding="3" width="100%" align="center" bgColor="#000000"
				border="0">
				<tr class="TableHeader" style="CURSOR: hand" onclick="clickMenu('menu_2')">
					<td noWrap align="center" colSpan="5"><b>索引(按姓氏)</b></td>
				</tr>
			</table>
			<table class="small" id="menu_2" style="DISPLAY: none" cellSpacing="1" cellPadding="3"
				width="100%" bgColor="#000000" border="0">
				<asp:panel id="pnlNoInitial" runat="server" Visible="False">
				<tr class="TableData" align="center">
					<td class="menu_comon" id="index_1" onmouseover="setIndexPointer(this, '#B3D1FF',1)" style="CURSOR: hand"
						onmouseout="setIndexPointer(this, '#FFFFFF',1)" noWrap width="100%">无记录</td>
				</tr>
				</asp:panel>
				<asp:repeater id="rptPY" runat="server" EnableViewState="False">
				<ItemTemplate>
				<tr class="TableData" align="center">
				<td width="100%" class="menu_comon" id="index_<%#Eval("ID")%>" onclick="view_index(this,'<%#Eval("Initial")%>','<b><%#Eval("Initial")%></b>(<%#Eval("Nums")%>)',<%#Eval("ID")%>)" onmouseover="setIndexPointer(this, '#B3D1FF',1)" onmouseout="setIndexPointer(this, '#FFFFFF',<%#Eval("ID")%>)" style="cursor:hand"><b><%#Eval("Initial")%></b>(<%#Eval("Nums")%>)</td>
				</tr>
				</ItemTemplate>
				</asp:repeater>
				</table>
			<script language="JavaScript">
var index_id=0;
var index_nums = <% =ViewState["IndexNums"] %>;

function setIndexPointer(theRow, thePointerColor,index_id_over)
{
   if(index_id!=index_id_over)
  {
	if(thePointerColor == "#B3D1FF")
		theRow.className="menu_active";
	else
		theRow.className="menu_comon";
  }
}

function view_index(theRow,id_str,table_str,index_count)
{
   parent.main.location="address_index.aspx?index="+id_str+"&TABLE_STR="+table_str;
   parent.main.location="initial.aspx?index="+id_str;
   index_id=index_count;
   
  for(i=1;i<=group_nums;i++)
	{
	targetelement=document.all('group_' + i);
	targetelement.className="menu_comon";		
	}
     
   if(index_nums > 1)
   {
     for(i=1;i<=index_nums;i++)
     {
		targetelement=document.all('index_' + i);
		targetelement.className="menu_comon";
     }
   }
   theRow.className="menu_active";
}
			</script>
			<!---------------------- 查找 -------------------------------->
			<table class="small" cellSpacing="1" cellPadding="3" width="100%" align="center" bgColor="#000000"
				border="0">
				<tr class="TableHeader" style="CURSOR: hand" onclick="parent.main.location='query.aspx'">
					<td noWrap align="center" colSpan="5"><b>查找(关键字)</b></td>
				</tr>
			</table>
			<!---------------------- 管理分组 -------------------------------->
			<table class="small" cellSpacing="1" cellPadding="3" width="100%" align="center" bgColor="#000000"
				border="0">
				<tr class="TableHeader" style="CURSOR: hand" onclick="parent.main.location='group.aspx'">
					<td noWrap align="center" colSpan="5"><b>管理分组</b></td>
				</tr>
			</table>
			</form>
	</body>
</HTML>
